This invention relates to keeping track of locations in electronic files and in electronic documents.
An electronic document typically has information content (e.g., text, graphics, and tables), formatting content that specifies how to display the information content, and control content that affects the flow of the information content. An electronic document may reside on a digital computer storage medium. Electronic documents may be widely distributed and therefore viewed on a variety of hardware and software platforms.
Document publishing systems, including desktop publishing systems and word processing systems, use various techniques to keep track of locations in an electronic document. Some document publishing systems only keep track of the cursor location. Some systems have routines that perform distinct functions, such as a spell checker or a search tool. These routines may independently keep track of locations relevant to their specific functions. Other systems allow only one such routine to be active at one time, so that at any given time the system only needs to keep track of one set of locations.
It is known that locational data for one or more routines can be stored in a data structure, such as a list, and a routine can use an identifier to access the relevant locational data. The locational data in the data structure can be updated without affecting the identifier.
A document publishing system may refer to a location in an electronic document by using an absolute address, an offset from the beginning or other fixed point in the electronic document, or a line number and an offset. Another technique for indicating locations is to insert a token in the electronic document. The system recognizes the tokens because the tokens have specific delimiters (e.g., “<” and “>” used by the HyperText Markup Language). Inserting tokens is often inefficient because the system expends resources searching for the tokens. Furthermore, the system may not recognize an embedded token in the document and produce an error when the token is encountered.